import React from "react";
import { Row } from "antd";
import styles from "./HomeWidget.less";

export function HomeLabel({ title, count, unit = "个", onClick }) {
  return (
    <Row className={styles.root} onClick={onClick}>
      <Row className={styles.title}>{title}</Row>
      <Row>
        <span className={styles.count}>{count}</span>
        <span className={styles.unit}>{unit}</span>
      </Row>
    </Row>
  );
}

export function ListItem({ title, more, extra }) {
  return (
    <Row className={styles.listRoot}>
      <Row className={styles.listTitle}>{title}</Row>
      <Row type="flex" justify="space-between">
        <span className={styles.more}>{more}</span>
        <span className={styles.extra}>{extra}</span>
      </Row>
    </Row>
  );
}
